<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>dialog</title>
<link rel="stylesheet" type="text/css" href="css/main.css" />
<link rel="stylesheet" type="text/css" href="css/SyntaxHighlighter.css" />

<script type="text/javascript" src="js/shCore.js"></script>
<script type="text/javascript" src="js/shBrushJScript.js"></script>
<script type="text/javascript" src="js/shBrushXml.js"></script>
</head>
<body style="text-align:left">
<div style="padding:10px">

<h3>Dialog</h3>
<p>Extend from $.fn.window.defaults. Override defaults with $.fn.dialog.defaults.</p>
<p>
The dialog is a special type of window, which can has a toolbar on top and a button bar on bottom.
The dialog has only one close tool display on top right of header by default.
Users can configure dialog behaviors to display other tools such as collapsible, minimizable, maximizable tool, etc.
</p>
<img src="images/dialog.png">

<h4>Dependencies</h4>
<ul>
	<li>window</li>
	<li>linkbutton</li>
</ul>

<h4>Usage</h4>
<p>
Create dialog via markup from an existing DOM node.
The example below shows a modal dialog with resizable feature.
</p>
<div class="dp-highlighter"><div class="bar"><div class="tools"></div></div><ol start="1" class="dp-xml"><li class="alt"><span><span class="tag">&lt;</span><span class="tag-name">div</span><span>&nbsp;</span><span class="attribute">id</span><span>=</span><span class="attribute-value">"dd"</span><span>&nbsp;</span><span class="attribute">class</span><span>=</span><span class="attribute-value">"easyui-dialog"</span><span>&nbsp;</span><span class="attribute">title</span><span>=</span><span class="attribute-value">"My&nbsp;Dialog"</span><span>&nbsp;</span><span class="attribute">style</span><span>=</span><span class="attribute-value">"width:400px;height:200px;"</span><span>&nbsp;&nbsp;</span></span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class="attribute">data-options</span><span>=</span><span class="attribute-value">"iconCls:'icon-save',resizable:true,modal:true"</span><span class="tag">&gt;</span><span>&nbsp;&nbsp;</span></span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;Dialog&nbsp;Content.&nbsp;&nbsp;</span></li><li class=""><span><span class="tag">&lt;/</span><span class="tag-name">div</span><span class="tag">&gt;</span><span>&nbsp;&nbsp;</span></span></li></ol></div><textarea class="html" name="code-dialog" style="display: none;">	&lt;div id="dd" class="easyui-dialog" title="My Dialog" style="width:400px;height:200px;"
			data-options="iconCls:'icon-save',resizable:true,modal:true"&gt;
		Dialog Content.
	&lt;/div&gt;
</textarea>
<p>
Creating dialog using javascript is also allowed.
Now let's create a modal dialog and then call 'refresh' method to load its content via ajax.
</p>
<div class="dp-highlighter"><div class="bar"><div class="tools"></div></div><ol start="1" class="dp-xml"><li class="alt"><span><span class="tag">&lt;</span><span class="tag-name">div</span><span>&nbsp;</span><span class="attribute">id</span><span>=</span><span class="attribute-value">"dd"</span><span class="tag">&gt;</span><span>Dialog&nbsp;Content.</span><span class="tag">&lt;/</span><span class="tag-name">div</span><span class="tag">&gt;</span><span>&nbsp;&nbsp;</span></span></li></ol></div><textarea class="html" name="code-dialog" style="display: none;">	&lt;div id="dd"&gt;Dialog Content.&lt;/div&gt;
</textarea>
<div class="dp-highlighter"><div class="bar"><div class="tools"></div></div><ol start="1" class="dp-c"><li class="alt"><span><span>$(</span><span class="string">'#dd'</span><span>).dialog({&nbsp;&nbsp;</span></span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;title:&nbsp;<span class="string">'My&nbsp;Dialog'</span><span>,&nbsp;&nbsp;</span></span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;width:&nbsp;400,&nbsp;&nbsp;</span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;height:&nbsp;200,&nbsp;&nbsp;</span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;closed:&nbsp;<span class="keyword">false</span><span>,&nbsp;&nbsp;</span></span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;cache:&nbsp;<span class="keyword">false</span><span>,&nbsp;&nbsp;</span></span></li><li class="alt"><span>&nbsp;&nbsp;&nbsp;&nbsp;href:&nbsp;<span class="string">'get_content.php'</span><span>,&nbsp;&nbsp;</span></span></li><li class=""><span>&nbsp;&nbsp;&nbsp;&nbsp;modal:&nbsp;<span class="keyword">true</span><span>&nbsp;&nbsp;</span></span></li><li class="alt"><span>});&nbsp;&nbsp;</span></li><li class=""><span>$(<span class="string">'#dd'</span><span>).dialog(</span><span class="string">'refresh'</span><span>,&nbsp;</span><span class="string">'new_content.php'</span><span>);&nbsp;&nbsp;</span></span></li></ol></div><textarea class="js" name="code-dialog" style="display: none;">	$('#dd').dialog({
		title: 'My Dialog',
		width: 400,
		height: 200,
		closed: false,
		cache: false,
		href: 'get_content.php',
		modal: true
	});
	$('#dd').dialog('refresh', 'new_content.php');
</textarea>

<br>
<h4>Properties</h4>
<p>The properties extend from window, below is the overridden properties for dialog.</p>
<table class="doc-table">
<tbody><tr>
<th><strong>Name</strong></th>
<th><strong>Type</strong></th>
<th><strong>Description</strong></th>
<th><strong>Default</strong></th>
</tr>
<tr>

<td>title</td>
<td>string</td>
<td>The dialog title text.</td>
<td>New Dialog</td>
</tr>
<tr>
<td>collapsible</td>
<td>boolean</td>
<td>Defines if to show collapsible button.</td>
<td>false</td>

</tr>
<tr>
<td>minimizable</td>
<td>boolean</td>
<td>Defines if to show minimizable button.</td>
<td>false</td>
</tr>
<tr>
<td>maximizable</td>
<td>boolean</td>
<td>Defines if to show maximizable button.</td>

<td>false</td>
</tr>
<tr>
<td>resizable</td>
<td>boolean</td>
<td>Defined if the dialog can be resized.</td>
<td>false</td>
</tr>
<tr>
<td>toolbar</td>
<td>array,selector</td>

<td>
The top toolbar of dialog, possible values:<br>
1) an array, each tool options are same as linkbutton.<br>
2) a selector that indicating the toolbar.
<p>The dialog toolbar can be declared within a &lt;div&gt; tag:</p>
<pre>&lt;div class="easyui-dialog" style="width:600px;height:300px"
		data-options="title:'My Dialog',toolbar:'#tb',modal:true"&gt;
	Dialog Content.
&lt;/div&gt;
&lt;div id="tb"&gt;
&lt;a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-edit',plain:true"/a&gt;
&lt;a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-help',plain:true"/a&gt;
&lt;/div&gt;
</pre>
<p>The dialog toolbar can also be defined via array:</p>
<pre>&lt;div class="easyui-dialog" style="width:600px;height:300px"
		data-options="title:'My Dialog',modal:true,
			toolbar:[{
				text:'Edit',
				iconCls:'icon-edit',
				handler:function(){alert('edit')}
			},{
				text:'Help',
				iconCls:'icon-help',
				handler:function(){alert('help')}
			}]"&gt;
	Dialog Content.
&lt;/div&gt;
</pre>
</td>
<td>null</td>
</tr>
<tr>
<td>buttons</td>
<td>array,selector</td>
<td>
The bottom buttons of dialog, possible values:<br>
1) an array, each button options is same as linkbutton.<br>
2) a selector that indicating the button bar.
<p>The buttons can be declared within a &lt;div&gt; tag:</p>
<pre>&lt;div class="easyui-dialog" style="width:600px;height:300px"
		data-options="title:'My Dialog',buttons:'#bb',modal:true"&gt;
	Dialog Content.
&lt;/div&gt;
&lt;div id="bb"&gt;
	&lt;a href="#" class="easyui-linkbutton"&gt;Save&lt;/a&gt;
	&lt;a href="#" class="easyui-linkbutton"&gt;Close&lt;/a&gt;
&lt;/div&gt;
</pre>
<p>The buttons can also be defined via array:</p>
<pre>&lt;div class="easyui-dialog" style="width:600px;height:300px"
		data-options="title:'My Dialog',modal:true,
			buttons:[{
				text:'Save',
				handler:function(){...}
			},{
				text:'Close',
				handler:function(){...}
			}]"&gt;
	Dialog Content.
&lt;/div&gt;
</pre>
</td>
<td>null</td>
</tr>
</tbody></table>

<h4>Events</h4>
<p>The events extend from window.</p>

<h4>Methods</h4>
<p>The methods extend from window, below is the added methods for dialog.</p>
<table class="doc-table">
<tbody><tr>
<th><strong>Name</strong></th>

<th><strong>Parameter</strong></th>
<th><strong>Description</strong></th>
</tr>
<tr>
<td>dialog</td>
<td>none</td>
<td>Return the outer dialog object.</td>
</tr>
</tbody></table>

</div>
</body>
</html>